<template>
  <el-container>
    <el-main>
      <el-descriptions title="高速公路详情" direction="horizontal" :column="2" border>
        <el-descriptions-item label="高速公路id">{{content.highRoadsId}}</el-descriptions-item>
        <el-descriptions-item label="高速公路名称">{{content.highRoadName}}</el-descriptions-item>
        <el-descriptions-item label="起始结点" :span="2">{{content.beginNode.nodeName}}</el-descriptions-item>
        <el-descriptions-item label="终点结点">{{content.endNode.nodeName}}</el-descriptions-item>
        <el-descriptions-item label="限长">{{content.truckLength}}</el-descriptions-item>
        <el-descriptions-item label="限宽" :span="2">{{content.truckWidth}}</el-descriptions-item>
        <el-descriptions-item label="限高" :span="2">{{content.truckHeight}}</el-descriptions-item>
        <el-descriptions-item label="限重" :span="2">{{content.truckWeight}}</el-descriptions-item>
        <el-descriptions-item label="限制轴数">{{content.truckAxes}}</el-descriptions-item>
        <el-descriptions-item label="限制轮胎数">{{content.truckTyres}}</el-descriptions-item>
        <el-descriptions-item label="路段状态">{{content.roadSegStatus}}</el-descriptions-item>
        <el-descriptions-item label="备注">{{content.roadSegComment}}</el-descriptions-item>
      </el-descriptions>
    </el-main>
  </el-container>

</template>

<script>
import axios from "axios";
import {ElMessage} from "element-plus";

export default {
  name: "expresswaysChild",
  props:{
    highRoadsId: Number
  },
  data(){
    return{
      content:{
        highRoadsId:"",
        highRoadName:"",
        beginNodeId:"",
        endNodeId:"",
        truckLength:"",
        truckWidth:"",
        truckHeight:"",
        truckWeight:"",
        truckAxes:"",
        truckTyres:"",
        roadSegStatus:"",
        roadSegComment:"",
        beginNode:{

        },
        endNode:{

        }
      }
    }
  },
  mounted() {
    axios({
      method: 'post',
      url: '/api/road/selectHighRoad',
      params:{
        id:this.highRoadsId
      }
    })
        .then((res)=>{

          if(res.data.code==="1"){//返回成功
            this.content=res.data.data.highRoad
          }else{//返回失败
            // alert("查询失败")
            ElMessage.warning('查询失败')
            this.$emit('wrong')
          }
        });
  }
}
</script>

<style scoped>
.el-container{
  height: 550px!important;
  width: 100%;
}
</style>